/**
 * Created by cc
 * Description:
 * User: CZH
 * Date: 2022-09-15
 * Time: 19:54
 */
class Person1{
    private String name;
    private int age;
    private String post;

    public Person1(){ }

    public Person1(String name) {
        this.name = name;
    }

    public Person1(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Person1(String name, int age, String post) {
        this.name = name;
        this.age = age;
        this.post = post;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPost() {
        return post;
    }

    public void setPost(String post) {
        this.post = post;
    }

    @Override
    public String toString() {
        return "Person1{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", post='" + post + '\'' +
                '}';
    }
}
public class HomeWork2 {

    //设计一个包含多个构造函数的类，并分别用这些构造函数来进行实例化对象。
    public static void main(String[] args) {
        Person1 p1 = new Person1();
        Person1 p2 = new Person1("abc");
        Person1 p3 = new Person1("abc",23);
        Person1 p4 = new Person1("assdf",24,"123");

    }
}
